<style type="text/css">
.storelogo img{width:3.2rem;height:3.2rem}
.merchgroup .store-star {padding:0.1rem 0 0.2rem 0;font-size:0.55rem;line-height:1rem}
.merchgroup .store-star img{height:0.66rem}
.star-on,.star-off{position:absolute;top:1rem;left:0;overflow:hidden}
.star-rate {margin-left:0.2rem;color:#19b955}
.store-distance{float:right;color:#999}
.store-moneylimit{font-size:0.55rem}
.delete{color: #bebebe;text-decoration:line-through;font-size:0.55rem}
.num_box{position:relative;overflow:hidden;width:100%;}
.num_box .num_box_ul{overflow:hidden;padding:15px 0;width:100%;line-height:22px;background-color: #f9f9f9;
    display: block;
    border-bottom: 1px #EFEFEF solid;}
.num_box .num_box_ul li{float:left;width:33%;border-right:1px solid #CCC;list-style:none}
.num_box .num_box_ul li:last-child{border:none}
.num_box .num_box_ul li span{display:block;width:100%;color:#707070;text-align:center;font-size:14px;line-height:20px}
.num_box .num_box_ul li span.text{margin:0;padding:0;background-color:transparent;box-shadow:none;font-size:12px}
.num_box .join_us{display:block;margin:10px auto;width:94%;height:40px;border-radius:4px;background:#FF4238;text-align:center;line-height:40px}
.num_box .join_us a:link, .num_box .join_us a:visited{display:block;color:#FFF;text-decoration:none;font-size:18px}
.absolute-r{
	float: right;
    position: absolute;
    bottom: 20px;
    right: 5px;
}
.fui-picturew .item .vote-number{
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    padding: 0 10px;
    -webkit-border-bottom-right-radius: 5px;
    -moz-border-radius-bottomright: 5px;
    border-bottom-left-radius: 5px;
    height: 25px;
    line-height: 25px;
    background-color: #000;
    background-color: rgba(0,0,0,0.5);
    color: #FFF;
    text-align: center;
    font-size: 12px;
}
.fui-picturew .item .vote-status{
    position: absolute;
    top: 0;
    right: 0;
    overflow: hidden;
    padding: 0 10px;
    -webkit-border-bottom-right-radius: 5px;
    -moz-border-radius-bottomright: 5px;
    border-bottom-left-radius: 5px;
    height: 25px;
    line-height: 25px;
    background-color: #red;
    background-color: rgba(0,0,0,0.5);
    color: #FFF;
    text-align: center;
    font-size: 12px;
}
</style>
<div class="fui-page order-create-page fui-page-current" ng-if="pagedata.op =='main'" style="background:#fff">
	<div class="fui-content">
		<div style="background-image:url('{{tomedia(reply.o_img) || '../addons/jy_meifa/resource/images/top-bg.png'}}');">
			<div class="headinfo" style="height:6.0rem;background-color:{{pagedata.pluginset.o_color || 'red'}};filter:Alpha(opacity=50);opacity:0.8;">
				<div class="fui-title-c" style="width:100%;height:100%;margin-left:1rem;margin-right:1rem">
					<div class="child userinfo" style="width:100%;">
						<a style="color: white;">
							<div class="face"><img ng-src="{{tomedia(pagedata.member.avatar) || '../core/resource/images/nopic.jpg'}}" /></div>
							<div class="name">我的参赛作品</div>
							<div class="subtitle" style="font-size:12px;color:#fff"><span>已上传：{{pagedata.sum}}个参赛作品</span></div>
						</a>
					</div>
				</div>
				<div class="water">
					<div class="water-1"></div>
					<div class="water-2"></div>
				</div>
			</div>
		</div>
		<div class="fui-searchbar bar">
			<div ng-class="{'searchbar center':1,'searchbar-active':pagedata.searchbar ==1}">
						<input type="button" ng-click="pagedata.getlist(1);"  value="搜索" class="searchbar-cancel searchbtn">
						<div class="search-input" ng-click="pagedata.searchbar =1">
							<input type="search" placeholder="输入关键字" class="search" ng-model="pagedata.params.keyword">
						</div>
			</div>
		</div>
		<div class="fui-picturew row-2" id="goodslist" style="padding: {paddingtop}px {paddingleft}px; background: {background};">
                <a ng-repeat="item in pagedata.list" class="item"  style="padding: 5px;">
                    <div class="image">
						<div class="vote-number">{{item.statustitle}}</div>
						<div class="vote-status">{{item.isshow ==1?'已公开':'已隐藏'}}</div>
                        <img style="width:100%;height:180px;" ng-click="access_json('jy_xiuvote/o_detail/main/id='+item.id)" ng-src="{{tomedia(item.thumb) || '../core/resource/images/nopic.jpg'}}">
                        <div class="title" style="color: {titlecolor}; text-align: {titlealign};">{{item.title}}</div>
						<div class="pics" style="margin-top:1rem">{{item.picsnum || 0}}P</div>
						<div class="absolute-r">
							<span ng-if="item.status!=0" ng-click="pagedata.open(item.id);toogle(item,'isshow',[1,0])" class="jylabel jylabel-red active" style="margin-right:0.2rem">{{item.isshow ==1?'隐藏':'公开'}}</span>
							<span ng-if="item.status!=0" ng-click="access_json('jy_xiuvote/upopus//id='+item.id)" class="jylabel jylabel-red active" style="margin-right:0.2rem">编辑</span>
							<span ng-click="post({},'del','id='+item.id,'','确认删除吗？')" class="jylabel jylabel-red active">删除</span>
                    </div>
					</div>
                </a>
		</div>
		<div ng-show="loading" class='infinite-loading'><span class='fui-preloader'></span><span style="margin-left:1.5rem"> 正在加载...</span></div>
	</div>
</div>
<div class='fui-page fui-page-current' ng-if="pagedata.op=='edit'">
	<div class="fui-header">
			<div class="fui-header-left" onclick="window.history.go(-1);">
				<a class="back"></a>
			</div>
			<div class="title">上传参赛作品</div>
			<div class="fui-header-right"></div>
	</div>
	<div class="fui-content">
	<div class="weui_cells weui_cells_form">
				<div class="weui_cell weui_vcode">
					<div class="weui_cell_hd"><label class="weui_label">参赛作品名称</label></div>
					<div class="weui_cell_bd weui_cell_primary">
						<input class="weui_input" type="text" ng-model="pagedata.post.title" placeholder="请输入您的作品名称">
					</div>
				</div>
	</div>
	<div class="weui_cell weui_vcode">
					<div class="weui_cell_hd"><label class="weui_label">参赛选手姓名</label></div>
					<div class="weui_cell_bd weui_cell_primary">
						<input class="weui_input" type="text" ng-model="pagedata.post.realname" value="{{pagedata.post.realname}}" placeholder="{{pagedata.member.realname||'请输入参赛选手姓名'}}">
					</div>
				</div>
				<div class="weui_cell weui_vcode">
					<div class="weui_cell_hd"><label class="weui_label">参赛选手年龄</label></div>
					<div class="weui_cell_bd weui_cell_primary">
						<input class="weui_input" type="text" ng-model="pagedata.post.age" value="{{pagedata.post.age}}" placeholder="请输入参赛选手年龄">
					</div>
				</div>
				<div class="weui_cell weui_vcode">
					<div class="weui_cell_hd"><label class="weui_label">参赛选手性别</label></div>
					<div class="weui_cell_bd weui_cell_primary" style="width:33%">
								<select ng-model="pagedata.post.sexid" class="form-control tpl-province">
								<option value="" selected="selected">选择性别</option>
								<option ng-repeat="(key,value) in pagedata.sex" value="{{key}}" ng-selected="pagedata.post.sexid==value">{{value}}</option>
								</select>
					</div>
				</div>
	<div class="weui_cells_title">参赛宣言</div>
	<div class="weui_cells weui_cells_form">
            <div class="weui_cell">
                <div class="weui_cell_bd weui_cell_primary">
                    <textarea class="weui_textarea" ng-model="pagedata.post.description" placeholder="请用一句话来，代表您作品的宣言！" rows="3"></textarea>
                    <div class="weui_textarea_counter">建议68个字以内！</div>
                </div>
            </div>
    </div>
	<div class="weui_cells_title">上传参赛图片</div>
	<div class="weui_cells weui_cells_form">
            <div class="weui_cell">
                <div class="weui_cell_bd weui_cell_primary">
                    <div class="weui_uploader">
                        <div class="weui_uploader_bd">
                            <ul class="weui_uploader_files">
                                <li ng-repeat="p in pagedata.post.opus_images" class="weui_uploader_file" style="background-image:url('{{tomedia(p)}}')">
									<div class="upbtn" >
										<a style="color:#f60" href="javascript:;" ng-click="pagedata.post.opus_images.splice($index-1,0,p);pagedata.post.opus_images.splice($index+1,1)">上移</a>
										<a style="color:#f60" href="javascript:;" ng-click="pagedata.post.opus_images.splice($index,1)">删除</a>
									</div>
								</li>
                            </ul>
                            <div class="weui_uploader_input_wrp" href="javascript:;" ng-click="images(pagedata.post,'opus_images')">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
    </div>
	<div class="weui_cells">
	<div class="weui_cell weui_cell_switch">
                <div class="weui_cell_hd weui_cell_primary">是否公开</div>
                <div class="weui_cell_ft">
                    <input class="weui_switch" type="checkbox" ng-model="pagedata.post.isshow">
                </div>
    </div>
	</div>
	<div class="weui_btn_area">
			 <a class="weui_btn weui_btn_primary" href="javascript:" id="showTooltips" ng-click="post(pagedata.post,'edit')">提交</a>
	</div>
</div>
</div>
<div ng-include="sys_html('_footer')"></div>
<script>
scope.pagedata.open=function(id){

	var params={
		data:{'id':id},
		op:'open',
		callback:function(res){
		 scope.message(res);
		 
		}
	};
	scope.post_json(params);
}
scope.pagedata.submit=function(){
	if(!scope.pagedata.post.title){
		scope.message('标题不能为空！','error');
		return false;
	}
	if(!scope.pagedata.post.description){
		scope.message('描述不能为空！','error');
		return false;
	}
	if(scope.pagedata.post.opus_images.length<1){
		scope.message('图片不能为空！','error');
		return false;
	}
	if(votestrlen(scope.pagedata.post.title)>40){
		scope.message('标题不能超过20个字！','error');
		return false;
	}
	if(votestrlen(scope.pagedata.post.description)>200){
		scope.message('描述不能超过100个字！','error');
		return false;
	} 
	var post=angular.copy(scope.pagedata.post);
	scope.post(post,'edit');
}
</script>
<script>
scope.loading = true;  //状态标记
scope.isnodata = false;
scope.pagedata.list =[];
//滚动加载
scope.pagedata.params =[]
scope.pagedata.params.keyword = ''
var page = 1;
scope.pagedata.getlist=function(type){
		if(type==1){
			page = 1;
			scope.pagedata.list =[];
		}else{
			
		}
		scope.get('jy_xiuvote/myopus/getlist/page='+page+'&keyword='+scope.pagedata.params.keyword,
				function(data){
							if(data.error !=1){
								for (var i=0;i<data.list.length;i++){
									scope.pagedata.list.push(data.list[i]);
								}
								if(page >1){
									$("#goodslist").animate({scrollTop:0},300);
								}
								if(data.list.length<1){
									scope.isnodata=true;
								}
								page++;
								scope.loading = false;
								scope.$evalAsync();
							}else{
								console.log('error');
							};
					}
		
		);
}
scope.pagedata.getlist();
window.addEventListener('scroll', function () {
    if(!scope.isnodata && !scope.loading &&  window.pageYOffset + window.innerHeight >= document.documentElement.scrollHeight){
        scope.loading = true;  //状态标记
		scope.pagedata.getlist();
     }
})
</script>
